import React from "react";
import OrgTree from "react-org-tree";

const Tree = ({ data, getDepartmentDetail }: any) => {
  const horizontal = false; // true：横向  false：纵向
  const collapsable = true; // true：可折叠 false：不可折叠
  const expandAll = true; // true: 全部展开 false：全部折叠

  return (
    <OrgTree
      data={data}
      horizontal={horizontal}
      collapsable={collapsable}
      expandAll={expandAll}
      onClick={getDepartmentDetail}
      labelClassName="cursor-pointer"
    />
  );
};

export default Tree;
